<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@include file="../../common/include_list_head.jsp" %>
    <script type="text/javascript">
        function extractUsers() {
            var url = "../jsonVisitor/ajaxSys-extractUsers.action?" + (new Date()).getTime();
            $.getJSON(url, function (data) {
                var isSuccess = data.datamap.isSuccess;
                if (isSuccess) {
                    alert("同步用户成功！");
                } else {
                    alert("同步用户失败！");
                }
            });
        }
    </script>
</head>
<body>
<div id="scrollContent">

    <s:if test="actionErrors.size()>0 || actionMessages.size()>0 || fieldErrors.size()>0">
        <div id="SystemErrorMessage">
            <s:actionerror/>
            <s:actionmessage/>
            <s:fielderror/>
        </div>
    </s:if>

    <s:form theme="simple" name="ysform">
        <s:hidden name="pager.formname" value="ysform"/>
        <s:hidden name="pager.currentPageno" id="yspager_currentPageno"/>
    </s:form>

    <div id="userRoleMenuButton">
        <button onclick="openEntity()"><span class="icon_add">新增</span></button>
        <button onclick="doModify()"><span class="icon_edit">修改</span></button>
        <button onclick="doRemove()"><span class="icon_delete">删除</span></button>
        <%--<button onclick="extractUsers()"><span class="icon_reload">用户同步</span></button>--%>
    </div>
    <div>
        <table class="tableStyle" style="width:100%;">
            <tr>
                <th width="3%"></th>
                <th nowrap="nowrap" width="8%" align="center">站点名称</th>
                <th nowrap="nowrap" width="10%" align="center">用户类型</th>
                <th nowrap="nowrap" width="15%" align="center">用户类型名称</th>
            </tr>
            <s:iterator value="resultData">
                <tr>
                    <td align="center"><s:checkbox id="%{wid}" name="selectNode" fieldValue="%{wid}"/></td>
                    <td nowrap="nowrap" align="center">
                        <a href="javascript:openEntity('<s:property value="wid"/>')">
                            <font color="blue">
                                <s:if test="groupid == 1">教职工</s:if>
                                <s:elseif test="groupid == 2">学生</s:elseif>
                                <s:elseif test="groupid == 3">校领导</s:elseif>
                            </font>
                        </a>
                    </td>
                    <td nowrap="nowrap" align="center"><s:property value="yhlx"/></td>
                    <td nowrap="nowrap" align="center"><s:property value="yhlxmc"/></td>
                </tr>
            </s:iterator>
        </table>
    </div>
</div>
</body>
</html>
